<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="/error.jsp"%>
<%@ page import="com.fredck.FCKeditor.*" %>
<%@ page import="com.beans.log.*"%> 
<%@ page import="com.business.log.*"%>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
function check()
{
       if(document.logform.title.value=="")
	   {
	          alert("标题不能为空");
			  document.logform.title.focus();
			  return false;
	   }
      	       
}
</script>
<%String title="修改日志"; %>
<%@include file="header.jsp"%>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<%	
	String logNo=request.getParameter("no");
	LogListBus llb=new LogListBus();
	LogInfo li=llb.getLogByNo(logNo); 
%>
<div class="main">

  <p>&nbsp;</p>
 
  <form id="logform" name="logform" method="post" action="addlog" onsubmit="return check()">
  	
	
  	
  	<p><label>日志类型:
  	
  	  <select name="logcategory"> 	
  	    <option value="0" <%if(li.getLogCategory().equals("0")){%> selected="selected"<%}%>>原创 </option>
  	    <option value="1" <%if(li.getLogCategory().equals("1")){%> selected="selected"<%}%>>转载</option>
  	    <option value="2" <%if(li.getLogCategory().equals("2")){%> selected="selected"<%}%>>翻译</option>
      </select> </label>
    </p>
	<br />
  	<p><label>日志分类
	<select name="logtypeid">
	<option value="0" >请选择分类</option>
	<%			LogTypeBus ltb=new LogTypeBus();
		List logTypeList=ltb.getAllLogTypes(username);
		for(int i=0;i<logTypeList.size();i++) {
		LogType lt=(LogType)logTypeList.get(i);
	%>
	<option value="<%=lt.getLogtypeId()%>" <%if(li.getLogtypeId().equals(lt.getLogtypeId())){%>selected<%}%>><%=lt.getLogtypeName()%></option>
	<%
		}
	%>
	</select>
	</label>
	</p>
	<br/>
  	<p>
	
    <label>标题：
    <input type="text" name="title"  value="<%=li.getLogTitle()%>"/>
    </label>
    <p>
      <label>内容：
      <%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath( basePath+"/FCKeditor/" ) ;
oFCKeditor.setHeight( "500" ) ;
oFCKeditor.setValue(com.util.TextTools.html2txt(li.getLogContent()));
out.println( oFCKeditor.create() ) ;
%>
      </label>
    </p>
	<br />
     <p>
      <label>摘要：
      <textarea name="intro"><%=com.util.TextTools.html2txt(li.getLogIntro())%></textarea>
      </label>
    </p>
    <br />
     <p>
      <label>
     <input type="checkbox" name="isshow" value="1" <%if(li.getIsShow().equals("1")){%>checked="checked"<%}%>/>是否显示出来
      </label>
    </p>
     <p>
      <label>
     <input type="checkbox" name="isquote" value="1" <%if(li.getIsQuote().equals("1")){%>checked="checked"<%}%> />
     是否推荐到系统首页      </label>
    </p>
     <p>
      <label>Tag:(请增加一个或多个，用“，”分开）
     <input type="text" name="logtag" value="<%=li.getLogTag()%>"/>
      </label>
    </p>
		<input type="hidden" name="log_quotenums" value="<%=li.getLogQuotenums()%>"/>
	   <input type="hidden" name="log_quote_id" value="<%=li.getLogQuoteId()%>"/>
		<input type="hidden" name="replynum" value="<%=li.getReplynum()%>"/>
		<input type="hidden" name="viewnums" value="<%=li.getViewnums()%>"/>
     <input type="hidden" name="logauthor" value="<%=username%>"/>
	 <input type="hidden" name="logno" value="<%=logNo%>"/>
	  <input type="hidden" name="action" value="update"/>
	
      <p>
        <label>
		<br />
  <center><input type="image" src="images/submit.gif" /></center>
      </label>
    </p>
    <p>&nbsp;</p>
  </form>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  
</div>
</body>
<%@include file="footer.jsp"%>
</html>
